package com.perfma.xtest.byd;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 *
 *
 * @author: junhui.si
 * @date: 2024-08-01 11:29
 **/
public class FIleC {
    public static void main(String[] args) {
        try {
            File file = new File("/home/dir");
            if (!file.exists()) {
                System.out.println();;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        String rn = "\r\n";
        try {
            File file = new File("/home/dir/1.txt");
            if (!file.exists()) {
                file.createNewFile();
            }
            FileOutputStream fos = new FileOutputStream(file.getAbsoluteFile(), true);
            fos.write(("1_" + System.currentTimeMillis()).getBytes());
            fos.write(rn.getBytes());
            fos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }


        try {
            File file = new File("/home/dir/2.txt");
            if (!file.exists()) {
                file.createNewFile();
            }
            FileOutputStream fos = new FileOutputStream(file.getAbsoluteFile(), true);
            fos.write(("2_" + System.currentTimeMillis()).getBytes());
            fos.write(rn.getBytes());
            fos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
